﻿using System;



class PrimeNumbers

{

    static void Main()

    {

        int count = 0;



        Console.WriteLine("101-200之间的素数有：");



        for (int num = 101; num <= 200; num++)

        {

            if (IsPrime(num))

            {

                Console.Write(num + " ");

                count++;

                if (count % 10 == 0)

                {

                    Console.WriteLine();

                }

            }

        }

        Console.WriteLine($"\n\n总共 {count} 个素数");

    }

    static bool IsPrime(int number)

    {

        if (number <= 1) return false;

        if (number == 2) return true;

        if (number % 2 == 0) return false;

        int boundary = (int)Math.Sqrt(number);



        for (int i = 3; i <= boundary; i += 2)

        {

            if (number % i == 0)

            {

                return false;

            }

        }



        return true;

    }

}